From a0dba440e59cb8473928f317f490fc1447e7d30d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Thu, 12 Jul 2018 16:47:10 +0200 Subject: [PATCH] babl: look deeper, and longer for path fishes We now do two iterations of +1 and +2 path lengths that take much longer than the configured path lengths - and now complain with a debug output listing the set of conversions taken to satisfy the request - giving hints on what parts could possibly be shortened to fewer steps. With this commit the first level of searching deeper also gets a debug message which would cause GIMP to print a message in some places where it earlier wouldnt have warned about missing fast paths. --- babl/babl-fish-path.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c index a22314d..30c4a68 100644 --- a/babl/babl-fish-path.c +++ b/babl/babl-fish-path.c @@ -568,8 +568,28 @@ babl_fish_path2 (const Babl *source, /* second attempt,. at path length + 1*/ if (babl->fish_path.conversion_list->count == 0 && max_path_length () + 1 <= BABL_HARD_MAX_PATH_LENGTH) + { get_conversion_path (&pc, (Babl *) source, 0, max_path_length () + 1, tolerance); + if (babl->fish_path.conversion_list->count) + { + fprintf (stderr, "babl is using a rather long chain, room exists for optimization here\n"); + babl_list_each (babl->fish_path.conversion_list, show_item, NULL); + } + } + + /* third attempt,. at path length + 2 */ + if (babl->fish_path.conversion_list->count == 0 && + max_path_length () + 2 <= BABL_HARD_MAX_PATH_LENGTH) + { + get_conversion_path (&pc, (Babl *) source, 0, max_path_length () + 2, tolerance); + if (babl->fish_path.conversion_list->count) + { + fprintf (stderr, "babl is using very long chain, should be optimized\n"); + babl_list_each (babl->fish_path.conversion_list, show_item, NULL); + } + } + babl_in_fish_path--; babl_free (pc.current_path); } -- 2.30.2